-
Notifications
You must be signed in to change notification settings - Fork 168
feat(event-handler): add support for error handling in AppSync GraphQL #4317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(event-handler): add support for error handling in AppSync GraphQL #4317
Conversation
…DatabaseError in AppSyncGraphQLResolver
… error types in AppSyncGraphQLResolver
…in AppSyncGraphQLResolver
…ame for better clarity
…n is based on error class name
I have one observation: while looking into the Python documentation, I realized they also accept list of errors for exception handling. Should we support that as well? |
Yes, that's what I'm doing in the API Gateway event handler so we should be consistent:
|
packages/event-handler/src/appsync-graphql/ExceptionHandlerRegistry.ts
Outdated
Show resolved
Hide resolved
packages/event-handler/tests/unit/appsync-graphql/AppSyncGraphQLResolver.test.ts
Show resolved
Hide resolved
packages/event-handler/src/appsync-graphql/ExceptionHandlerRegistry.ts
Outdated
Show resolved
Hide resolved
|
Summary
This PR adds support for error handling in AppSync GraphQL described in the issue
Changes
exceptionHandler
method is introduced to register an exception and its handler.ExceptionHandlerRegistry
is introduced to keep track of registered exception handlersexceptionHandler
is also exposed as a decorator methodendregion
added)Lambda handler:
APPSYNC JS resolver
Response mapping template
Response:
Issue number: closes #4130
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.